package cn.gson.crm.controller;

import cn.gson.crm.model.pojos.Complaints;
import cn.gson.crm.model.pojos.CustomerService;
import cn.gson.crm.model.service.CustomerService_Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
import java.util.Map;

@Controller
@RequestMapping("/CustomerServiceController")
public class CustomerServiceController {
    @Autowired
    CustomerService_Service customerService_service;
    @RequestMapping("/ContractMethod")
    @ResponseBody
    public Map<String,Object> selectcom(HttpSession session, Integer cid, Integer page, Integer size){

        return customerService_service.selectcom(session,cid,page,size);
    };
    //条件查询
    @RequestMapping("/ContractMethod1")
    @ResponseBody
    public Map<String,Object> selectwhere( HttpSession session,Integer cid, String where,Integer page, Integer size){

        return customerService_service.selectwhere(session,cid,where,page,size);
    };
    //根据时间查询
    @RequestMapping("/ContractMethod2")
    @ResponseBody
    public Map<String,Object> selecttime( HttpSession session,Integer cid, String statr, String endtime,Integer page, Integer size){
        return customerService_service.selecttime(session,cid,statr,endtime,page,size);
    };
    //新增
    @RequestMapping("/ContractMethod3")
    @ResponseBody
    public void  savecom(@RequestBody CustomerService complaints){
        customerService_service.savecom(complaints);
    }
    //删除
    @RequestMapping("/ContractMethod4")
    @ResponseBody
    public void deletCustomerService(@RequestBody CustomerService customerService){
        customerService_service.deletCustomerService(customerService);
    }
}
